<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>jsx 创建虚拟 DOM</title>
</head>

<body>
    <!-- 容器 -->
    <div id="test"></div>

    <!-- react.development 必须在 扩展 dom 之前引入 -->
    <script type="text/javascript" src="../js/react.development.js"></script>
    <script type="text/javascript" src="../js/react-dom.development.js"></script>
    <script type="text/javascript" src="../js/babel.min.js"></script>
    <script type="text/babel"> /* 此处一定要写 babel */
        // 创建虚拟 DOM 
        // const VDOM = <h1 id="title">hello react</h1>;
        const VDOM = (//此处为虚拟 DOM 不能加引号
            <h1 id="title">
                <span id="new">hello react</span>
            </h1>
        )
        // 渲染
        ReactDOM.render(
            VDOM,
            document.getElementById('test')
        )
    </script>
</body>

</html>